home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / AAVERAGE.HDR < prev    next >
Text File  |  1994-04-25  |  923b  |  43 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _AAverage( anArray ) --> nAverage
  8.  
  9. PARAMETERS:
  10.  
  11. anArray : Array of numeric values to average.
  12.  
  13. SHORT:
  14.  
  15. Get average value of a numeric array.
  16.  
  17. DESCRIPTION:
  18.  
  19. _AAverage() returns the average of the numeric elements given in anArray.
  20. NIL elements are not factored into the average so the result reflects only
  21. the average of actual values (inlcuding ZERO).
  22.  
  23.  
  24. NOTE:
  25.  
  26.  
  27.  
  28. EXAMPLE:
  29.  
  30. LOCAL anNums1 := { 1,2,3,4,5,6,7 } // 4
  31. LOCAL anNums2 := { 12.1,2.2,7.3,2.6,5.9,6.06,0.5 } // 5.24
  32.  
  33. i = _AAverage(anNums1)
  34. j = _AAverage(anNums2)
  35.  
  36. Result:
  37.  
  38. i = 4
  39. j = 5.237142857 (5.24 with SET DECIMALS TO 2)
  40.  
  41.  
  42. ******************************************************************************/
  43.